package com.zhenmaitang.clinic_sys.mapper;

import com.zhenmaitang.clinic_sys.entity.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PermissionMapper {
    
    List<Permission> findAll();
    
    Permission findById(Integer id);

    Permission findByCode(String code);

    List<Permission> findByResource(String resource);

    List<Permission> findByAction(String action);

    int insert(Permission permission);

    int update(Permission permission);

    int deleteById(Integer id);

    List<Permission> findPermissionsByRoleId(Integer roleId);

    List<Permission> findPermissionsByUserId(Integer userId);
}